#include <iostream>
using std::cout;
using std::endl;

class Point{
public:
    /* Point(){ */
    /*     cout << "Point()" << endl; */
    /* } */
//初始化列表写法和在构造函数的函数体中赋值的区别
#if 1
//初始化列表中是初始化
    Point(int x,int y)
    : _ix(x) //const int _ix = x
    , _iy(y) //const int _iy = y
    {
        cout <<"Point(int,int)" << endl;
    }
#endif

#if 0
    //在构造函数体中对数据成员赋值，其本质是赋值，并不算初始化
    Point(int x,int y){
        _ix = x;
        _iy = y;
    }
#endif

    void print(){
        cout << "(" << _ix << ","
            << _iy << ")" << endl;
    }
private:
    const int _ix;
    const int _iy;
    //C++11之后允许的写法
    /* const int _ix = 1; */
    /* const int _iy = 2; */
};

void test0(){

}

int main(void){
    test0();
    return 0;
}
